package org.hry.netty.channels;


import io.netty.bootstrap.ServerBootstrap;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelFuture;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.util.ReferenceCountUtil;

/**
 * @Desc
 * @Author houry
 * @Date 2021/2/20 15:18
 **/
public class NettyServer {
    public static void main(String[] args) {
        ByteBuf byteBuf = Unpooled.buffer();
        ReferenceCountUtil.release(byteBuf);
//        EventLoopGroup boss = new NioEventLoopGroup();
//        EventLoopGroup worker = new NioEventLoopGroup();
//        try{
//            ServerBootstrap server = new ServerBootstrap();
//            server.group(boss, worker).channel(NioServerSocketChannel.class).childHandler(new MyServerInitializer());
//            ChannelFuture channelFuture = server.bind(8899).sync();
//            channelFuture.channel().closeFuture().sync();
//        } catch (Exception e) {
//            e.printStackTrace();
//        } finally {
//            boss.shutdownGracefully();
//            worker.shutdownGracefully();
//        }

    }
}
